<template>
	<div>
    <div class="firstimg">
      <div class="login">
        <div class="loginstyle">
          <span>login</span>
          <span>|</span>
          <span>qrcode</span>
        </div>
        <input type="text" placeholder="name" class="input1">
        <span></span>
        <input type="password" placeholder="password" class="input1 pwd">
        <span></span>
        <a href="javascript:;"></a>
      </div>
    </div>
	</div>
</template>
<script>
	export default {
		mounted() {
		},
		methods: {
			phone() {
				let reg = /^1[3456789]\d{9}$/
				if (!reg.test(this.initial)) {
					this.phonecheck = 1
					this.changebuttonback()
				} else {
					this.phonecheck = 0
					this.changebutton()
				}
			},
			passconfirm() {
				let reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,18}$/
				if (this.passcon != this.pass) {
					this.passconf = 1
					this.changebuttonback()
				} else {
					this.passconf = 0
					this.changebutton()
				}
			},
			password() {
				let reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/
				if (!reg.test(this.pass)) {
					this.passcheck = 1
					this.changebuttonback()
				} else {
					this.passcheck = 0
					this.changebutton()
				}
			},
			changebuttonback() {
				let button = document.getElementsByClassName('button')
				button[0].setAttribute("disabled", true);
				button[0].style = "background:#a5afa4;box-shadow: 0 2px 6px #b2bcb0;"
			},
			changebutton() {
				if (this.phonecheck == 0 && this.passcheck == 0 && this.initial != "" && this.pass != "") {
					let button = document.getElementsByClassName('button')
					button[0].removeAttribute("disabled");
					button[0].style = "background:#00c39c;box-shadow: 0 2px 6px #01c39c;"
				}

				// this.$router.push('/login')
			}
		},
		data() {
			return {
			}
		},
	}
</script>
<style lang="scss" scoped="scoped">
.firstimg{
  height: 100%;
  position: relative;
}
.login{
  position: absolute;
  top: 85px;
  right: 420px;
  background-color: #faf6e7;
  min-width: 400px;
  min-height: 450px;
  max-width: 400px;
  max-height: 450px;
  border-radius: 20px;
  padding: 40px 50px;
  width: 100%;
}
.loginstyle{
  font-size: 24px;
  font-weight: bold;
  line-height: 24px;
  color: #c9990c;
  display: flex;
  justify-content: space-between;
  padding: 0px 20px;
}
.loginstyle>span:nth-child(2){
  display: block;
  padding: 0 20px;
  font-size: 30px;
  line-height: 20px;
  font-weight: 100;
};
input{
  background-color: transparent;
  display: block;
  color: #c9990c;
  width: 400px;
  &.pwd{
	  width: 100%;
	  background-color: transparent;
	  outline-style: none;
	  box-shadow: none;
	  border: 1px solid #d2ab35;
	  height: 40px;
  }
}
</style>
